package com.cg.resolvers;

import com.cg.entities.Pet;
import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsQuery;

import java.util.Arrays;
import java.util.List;

/**
 * @author cheyinbo
 * @description TODO
 * @date 2021/6/24 10:34
 */
@DgsComponent
public class PetResolver {

    @DgsQuery(field = "listPets")
    public List<Pet> listPets(){
        return Arrays.asList(
                new Pet(1,"金毛",3),
                new Pet(2,"牧羊犬",1),
                new Pet(3,"英短",2),
                new Pet(4,"美短",2),
                new Pet(5,"英格兰小乳猪",4),
                new Pet(6,"山猪",5)
        );
    }
}
